<include file="public@header"/>
<style type="text/css">
    .pic-list li {
        margin-bottom: 5px;
    }
</style>

</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('AdminFlower/type')}">花卉类型列表页</a></li>
        <li class="active"><a href="#">花卉类型添加</a></li>
    </ul>
    <form action="{:url('AdminFlower/edit')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
        <input name="id" value="{$flowertypes.id}" style="display: none">
        <div class="row">
            <div class="col-md-9">
                <table class="table table-bordered">
                    <tr>
                        <th style="text-align: center">花卉类型</th>
                        <td>
                            <textarea class="form-control" name="flowerType" style="height: 50px;"
                                      placeholder="格式：手捧花">{$flowertypes.name}</textarea>
                        </td>
                    </tr>
                    <tr>
                       <th style="text-align: center">展示图片1(375*175)</th>
                        <td>
                            <div>
                                <input type="hidden" name="more[thumbnail]" class="form-control"
                                       id="js-thumbnail-input" value="{$flowertypes.image}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input');">
                                        <img src="{$image}"
                                             id="js-thumbnail-input-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail"
                                           onclick="$('#thumbnail-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr style="display:none">
                       <th style="text-align: center">展示图片2(375*175)</th>
                        <td>
                            <div>
                                <input type="hidden" name="image2[thumbnail]" class="form-control"
                                       id="js-thumbnail-input2" value="{$flowertypes.image2}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input2');">
                                        <img src="{$image2}"
                                             id="js-thumbnail-input2-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail2"
                                           onclick="$('#thumbnail-preview2').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                  <if condition="$flowertypes.goodtype==0">
                    <tr>
                       <th style="text-align: center">首页展示内容图片(375*376)</th>
                        <td>
                            <div>
                                <input type="hidden" name="homepage[thumbnail]" class="form-control"
                                       id="js-thumbnail-input3" value="{$flowertypes.homepage}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input3');">
                                        <img src="{$homepage}"
                                             id="js-thumbnail-input3-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail3"
                                           onclick="$('#thumbnail-preview3').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                 </if>
                   
                    <tr>
                        <th style="text-align: center">首页展示标题图片(375*160)</th>
                        <td>
                            <div>
                                <input type="hidden" name="homepagetitile[thumbnail]" class="form-control"
                                       id="js-thumbnail-input4" value="{$flowertypes.homepagetitile}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input4');">
                                        <img src="{$homepagetitile}"
                                             id="js-thumbnail-input4-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail4"
                                           onclick="$('#thumbnail-preview4').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">产品展示页面标题图片(375*112)</th>
                        <td>
                            <div>
                                <input type="hidden" name="flowertitle[thumbnail]" class="form-control"
                                       id="js-thumbnail-input5" value="{$flowertypes.flowertitle}">
                                <div>
                                    <a href="javascript:uploadOneImage('图片上传','#js-thumbnail-input5');">
                                        <img src="{$flowertitle}"
                                             id="js-thumbnail-input5-preview"
                                             width="135" style="cursor: pointer"/>
                                    </a>
                                    <input type="button" class="btn btn-sm btn-cancel-thumbnail5"
                                           onclick="$('#thumbnail-preview5').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumbnail').val('');return false;"
                                           value="取消图片">
                                </div>
                            </div>
                        </td>
                    </tr>
                    <tr >
                        <th style="text-align: center">首页描述</th>
                        <td>
                            <input type="text" class="form-control" name="description" value="{$flowertypes.description}">
                        </td>
                    </tr>
                    <tr >
                        <th style="text-align: center">最低价格(元)</th>
                        <td>
                            <input type="text" class="form-control" name="bottomprice" value="{$flowertypes.bottomprice}" placeholder="请填入数字">
                        </td>
                    </tr>
                    <tr >
                        <th style="text-align: center">非花类产品</th>
                        <td>
                            <if condition="$flowertypes.goodtype==1">
                                   <input type="text" value='1' readonly name="goodtype" style="display:none">是
                                    
                                    <else/>
                     
                                    <input type="text" value='0' readonly name="goodtype" style="display:none">否
                                </if>

                            <!--<select class="form-control" name="goodtype" style="width: 140px;" readonly>
                                <if condition="$flowertypes.goodtype==1">
                                    <option value='1' selected>是</option>
                                    <option value="0">否</option>
                                    <else/>
                                    <option value='1' >是</option>
                                    <option value="0" selected>否</option>
                                </if>

                            </select>-->
                        </td>
                    </tr>
                 <!--   <tr >
                        <th style="text-align: center">你根本不知道的花加</th>
                        <td> <script type="text/plain" id="content" name="flowers[post_content]" style="height:200px;"></script>
                        </td>
                    </tr>
                    <tr>
                        <th style="text-align: center">完美服务带你飞</th>
                        <td><script type="text/plain" id="content2" name="service[post_content]" style="height:200px;"></script>
                        </td>
                    </tr>-->
                </table>
                <div class="form-group">
                    <div class="col-sm-offset-2 col-sm-10">
                        <button type="submit" class="btn btn-primary js-ajax-submit">{:lang('ADD')}</button>
                        <a class="btn btn-default" href="{:url('AdminFlower/type')}">{:lang('BACK')}</a>
                    </div>
                </div>
            </div>

        </div>
    </form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
    //编辑器路径定义
    var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
    $(function () {
        editorcontent = new baidu.editor.ui.Editor();
        editorcontent.render('content');

        editorcontent2 = new baidu.editor.ui.Editor();
        editorcontent2.render('content2');
        try {
            editorcontent.sync();
            editorcontent2.sync();
        } catch (err) {
        }
        editorcontent.ready(function(){
            console.log('{$flowertypes.knows}');
            editorcontent.setContent('{$flowertypes.knows}');
        });
        editorcontent2.ready(function(){
            editorcontent2.setContent('{$flowertypes.service}');
        });

        //$('#more-template-select').val('page');
    });
</script>
<script>
    $(function(){
        $('.btn-cancel-thumbnail').click(function () {
            $('#js-thumbnail-input-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input').val('');
        });
        $('.btn-cancel-thumbnail2').click(function () {
            $('#js-thumbnail-input2-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input2').val('');
        });
        $('.btn-cancel-thumbnail3').click(function () {
            $('#js-thumbnail-input3-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input3').val('');
        });
        $('.btn-cancel-thumbnail4').click(function () {
            $('#js-thumbnail-input4-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input4').val('');
        });
        $('.btn-cancel-thumbnail3').click(function () {
            $('#js-thumbnail-input3-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
            $('#js-thumbnail-input3').val('');
        });
    });
</script>
</body>
</html>